package com.bear.sgg.springboot_09_mybatis.controller;

import com.bear.sgg.springboot_09_mybatis.entity.Employee;
import com.bear.sgg.springboot_09_mybatis.mapper.EmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassNmae EmployeeController
 * @Description TODO
 * @Author bear
 * @Date 2020/3/16 0016 上午 9:59
 */
@RestController
public class EmployeeController {

    @Autowired
    private EmployeeMapper employeeMapper;

    @GetMapping(value = "/emp/{id}")
    public Employee selectEmpById(@PathVariable("id") Integer id) {
        return employeeMapper.selectEmpById(id);
    }

    @GetMapping(value = "emp/{lastName}/{email}/{gender}/{dId}")
    public int insertEmp(Employee employee){
        return employeeMapper.insertEmp(employee);
    }


}
